In a streaming service based on a Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP), a method of obtaining the streaming service by a user equipment (User Equipment, UE) includes: The UE sends a message to a server on a network side to request a metadata file corresponding to media presentation, receives a metadata file returned by the server, determines a media fragment corresponding to the described media presentation according to the media presentation description information included in the metadata file, and obtains and plays the media fragment.
When the media presentation is a live program, the end time of the live program cannot be determined beforehand, the server keeps updating the metadata file corresponding to the live program with elapse of time. To obtain a complete live program, the UE needs to keep updating the metadata file corresponding to the live program.
Currently, the UE updates the metadata file periodically. When the update period of the metadata file is set improperly, the UE may fail to normally obtain a streaming service. For example, as shown in FIG. 1, when the update period of the metadata file is set to a too large value, information about a part of media presentation (a media fragment 4 shown in FIG. 1) described by metadata file 2 is lost in the duration between t0 and t1, where t0 is the first time of updating the metadata file and t1 is the second time of updating the metadata file. Consequently, the UE is unable to obtain normal streaming service according to the metadata file 1 obtained in the first time of update and the metadata file 2 obtained in the second time of update.